<?php

//<editor-fold defaultstate="collapsed" desc="License & Copyright">
/*
 * @license
 */

/**
 *
 * @author Jevgeni Geimanen (jevgeni.geimanen@gmail.com)
 */
//</editor-fold>
abstract class SCStruct {

    public function __construct() {
        
    }
    /**
     *
     * @var ReflectionClass 
     */
    private $_RefClass = null;

    /**
     *
     * @return ReflectionClass
     */
    public function getRefClass() {
        return $this->_RefClass == null ? $this->_RefClass = new ReflectionClass($this) : $this->_RefClass;
    }

    /**
     *
     * @var string
     */
    private $_ClassName = null;

    /**
     *
     * @return string
     */
    public function getClassName() {
        if ($this->_ClassName === null)
            $this->_ClassName = get_class($this);
        return $this->_ClassName;
    }

    public function getRelativePath() {
        $paths = array(SCORE_PATH, SCORE_APP_LIB_PATH);
        $fileName = sCore::getRefClassFileName($this->getRefClass());
        foreach ($paths as $path) {
            if (($relative = substr($fileName, 0, strlen($path))) == $path) {
                return substr($fileName,strlen($path));
            }
        }
        return null;
    }

}